<?php
   $auth = Auth::getAuth('current_user');
   $userCompany = new userQueries();
   $company = $userCompany->getCompany($auth['company_id']);
   //functions::landing_page($auth);
?>
<div class="fl-option-toolbar">
    <div class="account-settings icon"></div>
    <div class="fl-toolbar-left-wrapper">
      <h1>Account Settings</h1>
    </div>
    <div class="fl-toolbar-right-wrapper">
        <!-- <a class="pinit icon dataTip" data-placement="left" data-original-title="Pin this to Dashboard"></a> -->
    </div>
     <div class="clearfix"></div>
  </div><!-- end of option toolbar -->
<div class="fl-account-settings">
   <div class="fl-tab-wrapper">
  <ul id="tabs">
      <li class="accountInfo_basicInformation"><a id="tab1">Basic Information</a></li>
      <li class="accountInfo_username"><a id="tab2">Change Your Username</a></li>
      <li class="accountInfo_password"><a id="tab3">Change Your Password</a></li>
      <?php
         if($auth['user_level_id']=="2"){
            echo '<li class="accountInfo_password"><a id="tab4">Company Information</a></li>';
         }
      ?>
      
 </ul>
 </div>
<div class="fl-head-title-wrapper">
  <h2>General Account Settings</h2>
</div>
     
    <div class="tab-container" id="tab1C"><span><i class="fa fa-pencil-square-o"></i> Change Basic Information</span>
   <div class="fl-edit-profile-wrapper">
    <div class="two-columns col" style="width:251px;">
      <div class="large-avatar-wrapper">
         <?php echo $userCompany->avatarPic("companyUser",$auth['id'],"230","230","large"," userPhoto personalPhoto"); ?>
      </div><Br/>
      <form action="/ajax/upload" method="POST" class="uploadingProfilePic" id="personal_photo" enctype="multipart/form-data">
                        <div class="pull-left">
                           <div id="uniform-fileInput" class="uploader">
                              <input type="file" data-action-id="2" value="upload" name="userProfilePic" id="uploadForm" data-action-type="userPhoto" size="24" style="opacity: 0;" class="upfile">
                                 <input type="hidden" value="companyUser" name="userType" />
                                 <span id="uploadFilename_2" class="filename">No file selected</span>
                                 <span class="action">Choose File</span>
                           </div>
                        </div>
                     </form>
                     <center style="margin-top:40px">
                       <div class="spinner  loaderUploadProfile display">
                         <div class="bar1"></div>
                         <div class="bar2"></div>
                         <div class="bar3"></div>
                         <div class="bar4"></div>
                         <div class="bar5"></div>
                         <div class="bar6"></div>
                        <div class="bar7"></div>
                        <div class="bar8"></div>
                        <div class="bar9"></div>
                        <div class="bar10"></div>
                      </div>
                   </center>
    </div>
    <div class="two-columns fl-edit-info-width">
      <form class="personal_info" method="POST">
         <?php
            if($auth['display_name']!=""){
         ?>
         <div class="fl-fields"><span class="theme-font-color">Display Name</span>:
           <div class="fl-input_position">
             <label class="uInfo_lbl label_value uInfo_<?php echo $auth['id'];?>" id="uInfo_displayName<?php echo $auth['id'];?>"><?php echo $auth['display_name'];?></label>
             <input type="text" id="eInfo_<?php echo $auth['id'];?>" name="displayName" class="uInfo_lbl display eInfo_<?php echo $auth['id'];?>" value="<?php echo $auth['display_name'];?>" style="margin-top:5px;">
    
            </div>
         </div>
         <?php
            }
            if($auth['first_name']!=""){
         ?>
         <div class="fl-fields"><span class="theme-font-color">First Name</span>:
           <div class="fl-input_position">
             <label class="uInfo_lbl label_value uInfo_<?php echo $auth['id'];?>" id="uInfo_firstName<?php echo $auth['id'];?>"><?php echo $auth['first_name'];?></label>
             <input type="text" id="eInfo_<?php echo $auth['id'];?>" name="firstName" class="uInfo_lbl display input-medium eInfo_<?php echo $auth['id'];?>" value="<?php echo $auth['first_name'];?>" style="margin-top:5px;">
           </div>
         </div>
         <?php
            }
            if($auth['middle_name']!=""){
         ?>
         <div class="fl-fields"><span class="theme-font-color">Middle Name</span>:
           <div class="fl-input_position"> 
             <label class="uInfo_lbl label_value uInfo_<?php echo $auth['id'];?>" id="uInfo_middleName<?php echo $auth['id'];?>"><?php echo $auth['middle_name'];?></label>
             <input type="text" id="eInfo_<?php echo $auth['id'];?>" name="middleName" class="uInfo_lbl display input-medium eInfo_<?php echo $auth['id'];?>" value="<?php echo $auth['middle_name'];?>" style="margin-top:5px;">
           </div>
         </div>
         <?php
            }
            if($auth['last_name']!=""){
         ?>
         <div class="fl-fields"><span class="theme-font-color">Last Name</span>:
           <div class="fl-input_position">
             <label class="uInfo_lbl label_value uInfo_<?php echo $auth['id'];?>" id="uInfo_lastName<?php echo $auth['id'];?>"><?php echo $auth['last_name'];?></label>
             <input type="text" id="eInfo_<?php echo $auth['id'];?>" name="lastName" class="uInfo_lbl display input-medium eInfo_<?php echo $auth['id'];?>" value="<?php echo $auth['last_name'];?>" style="margin-top:5px;">
           </div>
         </div>
         <?php
            }
            if($auth['contact_number']!=""){
         ?>
         <div class="fl-fields"><span class="theme-font-color">Contact Number</span>:
           <div class="fl-input_position">
             <label class="uInfo_lbl label_value uInfo_<?php echo $auth['id'];?>" id="uInfo_contactNumber<?php echo $auth['id'];?>"><?php echo "0".$auth['contact_number']; ?></label>
             <input type="text" id="eInfo_<?php echo $auth['id'];?>" name="contactNumber" class="uInfo_lbl display input-medium eInfo_<?php echo $auth['id'];?>" value="<?php echo "0".$auth['contact_number']; ?>" style="margin-top:5px;">
           </div>
         </div>
         <?php
            }
            if($auth['position']!=""){
         ?>
         <div class="fl-fields"><span class="theme-font-color">Position</span>:
           <div class="fl-input_position">
             <label class="uInfo_lbl label_value" id="uInfo_<?php echo $auth['id'];?>"><?php echo $auth['position'];?></label>
             
           </div>
         </div>
         <?php
            }
            if($auth['date_registered']!=""){
         ?>
         <div class="fl-fields"><span class="theme-font-color">Date Registered</span>:
           <div class="fl-input_position">
             <label class="uInfo_lbl label_value" id="uInfo_<?php echo $auth['id'];?>"><?php echo $auth['date_registered'];?></label>
           </div>
         </div>
         <?php
            }
         ?>
        <div class="fl-fields">
          <div class="fl-input_position">
            <label class="label_value uInfo_211"></label>
            
            <input type="button" data-action-type="personal_info" class="btn-blueBtn fl-btn-left fl-margin-right edit_personalInfo uInfo_<?php echo $auth['id'];?>" data-id="<?php echo $auth['id'];?>" id="edit_personalInfo" value="Edit" style="width:85px!important;">
            <input type="button" data-action-type="personal_info" class="btn-blueBtn fl-margin-right save_personalInfo eInfo_<?php echo $auth['id'];?> display" data-id="<?php echo $auth['id'];?>" id="save_personalInfo" value="Save">
            <input type="button" data-action-type="personal_info" class="fl-buttonEffect fl-margin-right btn-basicBtn cancel_personalInfo eInfo_<?php echo $auth['id'];?> display" data-id="<?php echo $auth['id'];?>" id="cancel_personalInfo" value="Cancel">
          </div>
        </div>
        </form>
    </div>
    <div class="clearfix"></div>
  </div>
    </div>
    <div class="tab-container" id="tab2C"><span><i class="fa fa-pencil-square-o"></i> Change Your Username</span>
         <div class="fl-fields">
          <span class="theme-font-color">Your Email</span>:
          <div class="fl-input_position">
            <input type="text" id="" name="" class="oldUsername" disabled="disabled" value="<?php echo $auth['email']; ?>" style="float: none;">
          </div>
          <div class="clearfix"></div>
        </div>
        <div class="fl-fields">
          <span class="theme-font-color">New Email</span>:
          <div class="fl-input_position">
               <input type="text" id="" name="" class="newUsername input-medium" value="" style="float:none;">
          </div>
          <div class="clearfix"></div>
        </div>
           <div class="fl-fields">
          <div class="fl-input_position">
            <label class="label_value uInfo_211"></label>
            <input type="button" class="btn-blueBtn updateUsername" value="Update"  style="float:none; margin-left:80px;">
            
          </div>
        </div>
    </div>
    <div class="tab-container" id="tab3C"><span><i class="fa fa-pencil-square-o"></i> Change Your Password</span>
       <div class="fl-fields">
          <span class="theme-font-color">Current</span>:
          <div class="fl-input_position">
            <input type="password" name="" class="oldPassword input-medium" id="oldPassword" style="float:none; margin-left: 27px;">
          </div>
          <div class="clearfix"></div>
        </div>
         <div class="fl-fields">
          <span class="theme-font-color">New</span>:
          <div class="fl-input_position">
            <input type="password" name="" class="newPassword input-medium" id="newPassword" value="" style="float:none; margin-left:50px;">
          </div>
          <div class="clearfix"></div>
        </div>
         <div class="fl-fields">
          <span class="theme-font-color">Retype-New</span>:
          <div class="fl-input_position">
            <input type="password" name="" class="ReTypePassword input-medium" id="retypePassword" value="" style="float:none;">
          </div>
          <div class="clearfix"></div>
        </div>
        <div class="fl-fields">
          <div class="fl-input_position">
            <label class="label_value uInfo_211"></label>
            <input type="button" class="btn-blueBtn updatePassword" value="Update" style="float:none; margin-left:85px;">
          </div>
        </div>
    </div>
    <!--COMPANY INFO -->
     <div class="tab-container" id="tab4C"><span><i class="fa fa-pencil-square-o"></i> Change Company Information</span>
   <div class="fl-edit-profile-wrapper">
    <div class="two-columns col" style="width:251px;">
      <div class="large-avatar-wrapper">
         <?php echo $userCompany->avatarPic("companyAdmin",$company['id'],"230","230","large"," companyPhoto"); ?>
      </div><Br/>
      <form action="/ajax/upload" method="POST" class="uploadingProfilePic" id="company_photo" enctype="multipart/form-data">
                        <div class="pull-left">
                           <div id="uniform-fileInput" class="uploader">
                              <input type="file" data-action-id="3" value="upload" name="userCompanyPic" id="uploadForm" data-action-type="companyPhoto" size="24" style="opacity: 0;" class="upfile">
                              <input type="hidden" value="companyAdmin" name="userType" />
                                 <span id="uploadFilename_3" class="filename">No file selected</span>
                                 <span class="action">Choose File</span>
                           </div>
                        </div>
                     </form>
                     <center style="margin-top:40px">
                       <div class="spinner  loaderUploadCompany display">
                         <div class="bar1"></div>
                         <div class="bar2"></div>
                         <div class="bar3"></div>
                         <div class="bar4"></div>
                         <div class="bar5"></div>
                         <div class="bar6"></div>
                        <div class="bar7"></div>
                        <div class="bar8"></div>
                        <div class="bar9"></div>
                        <div class="bar10"></div>
                      </div>
                   </center>
    </div>
    <div class="two-columns fl-edit-info-width">
     <form class="companyPersonal_info" method="POST">
         <div class="fl-fields"><span class="theme-font-color">Company Name:</span>:
           <div class="fl-input_position">
              <label class="label_value uCInfo_<?php echo $company['id'];?>" id="uCInfo_companyName<?php echo $company['id'];?>"><?php echo $company['name'];?></label>
             <input type="text" id="eInfo_<?php echo $company['id'];?>" name="companyName" class="display input-medium eCInfo_<?php echo $company['id'];?>" value="<?php echo $company['name'];?>" style="margin-top:5px;">
    
            </div>
         </div>
         <div class="fl-fields"><span class="theme-font-color">Company Code:</span>:
           <div class="fl-input_position">
             <label class="label_value uCInfo_<?php echo $company['id'];?>" id="uCInfo_companyCode<?php echo $company['id'];?>"><?php echo $company['code'];?></label>
                <input type="text" id="eInfo_<?php echo $company['id'];?>" name="companyCode" class="display input-medium eCInfo_<?php echo $company['id'];?>" value="<?php echo $company['code'];?>" style="margin-top:5px;">
           </div>
         </div>

         <div class="fl-fields"><span class="theme-font-color">Company Contact Number</span>:
           <div class="fl-input_position"> 
             <label class="label_value uCInfo_<?php echo $company['id'];?>" id="uCInfo_companyNumber<?php echo $company['id'];?>"><?php echo $company['contact_number'];?></label>
                <input type="text" id="eCInfo_<?php echo $company['id'];?>" name="companyNumber" class="display input-medium eCInfo_<?php echo $company['id'];?>" value="<?php echo $company['contact_number'];?>" style="margin-top:5px; width:81.3%;">
           </div>
         </div>
   
         <div class="fl-fields"><span class="theme-font-color">Position</span>:
           <div class="fl-input_position">
             <label class="label_value" id="uCInfo_<?php echo $company['id'];?>"><?php echo $company['position'];?></label>
                <!--<input type="text" id="eInfo_<?php echo $company['id'];?>" name="companyEmail" class="display input-medium eInfo_<?php echo $company['id'];?>" value="<?php echo $company['position'];?>">-->
           </div>
         </div>
        
         <div class="fl-fields"><span class="theme-font-color">Date Registered</span>:
           <div class="fl-input_position">
              <label class="label_value" id="uCInfo_<?php echo $company['id'];?>"><?php echo $company['date_registered'];?></label>
              <!--<input type="text" id="eInfo_<?php echo $company['id'];?>" name="companyEmail" class="display input-medium eInfo_<?php $company['id'];?>" value="<?php echo $company['date_registered'];?>">-->
           </div>
         </div>
       
        <div class="fl-fields">
          <div class="fl-input_position">
            <label class="label_value uInfo_211"></label>
            
            <input type="button" data-action-type="company_info" class="btn-blueBtn edit_personalInfo uCInfo_<?php echo $company['id'];?>" data-id="<?php echo $company['id'];?>" id="edit_personalInfo" value="Edit">
             <input type="button" data-action-type="company_info" class="btn-blueBtn fl-margin-right save_personalCInfo eCInfo_<?php echo $company['id'];?> display" data-id="<?php echo $company['id'];?>" id="save_personalInfo" value="Save">
               <input type="button" data-action-type="company_info" class="fl-buttonEffect btn-basicBtn cancel_personalCInfo eCInfo_<?php echo $company['id'];?> display" data-id="<?php echo $company['id'];?>" id="cancel_personalInfo" value="Cancel">
          </div>
        </div>
        </form>
    </div>
    <div class="clearfix"></div>
  </div>
  <iframe id="google_map" width="100%" height="350" src="https://maps.google.co.uk?output=embed" scrollbar="no"></iframe>
    </div>
</div>
  